<template>
  <div class="content-body" :style="borderStyle">
    <div class="user-content" :style="bodyStyle">
      <div class="user-image">
        <el-image class="user-tx" :src="user.avatarName === null ? userImage: baseURL + user.avatarName" />
      </div>
      <div class="user-right">
        <div class="user-right-body">
          <div class="user-info">
            <div class="user-content-body">
              {{ entity[setting.firstColumn] }}
            </div>
            <div class="user-content-body">
              <div class="content-span">{{ entity[setting.secondColumn] }}</div>
            </div>
          </div>
          <div v-if="setting.data" class="user-tj">
            <div v-for="(item,index) in setting.data" :key="'tj-'+index" class="user-content custom-padding">
              <visiting-slot :column="item" @fetch-data="userCallBack" />
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import VisitingSlot from './slot/visitingSlot'
import { mapGetters } from 'vuex'
import { mobile } from '@/mixins/mobile'
export default {
  name: 'PcVisitingCardV1',
  mixins: [mobile({ tabs: 'user' })],
  components: { VisitingSlot },
  computed: {
    ...mapGetters([
      'user'
    ])
  }
}
</script>

<style scoped>
.content-body {
  width: 100%;
  height: 100%;
  padding: 10px;
  box-sizing: border-box;
  overflow: hidden;
  background-color: #ffffff;
}
.user-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-flow: row nowrap;
  position: relative;
}
.user-image {
  width: 80px;
  position: absolute;
  height: 100%;
  text-align: center;
  top: 0;
  left: 0;
  padding: 0 10px;
  box-sizing: border-box;
}
.user-tx {
  width: 74px;
  height: 102px;
  top: 50%;
  margin-top: -51px;
  border-radius: 4px;
}
.user-right {
  position: absolute;
  left: 90px;
  right: 0;
  top: 0;
  height: 100%;
  display: flex;
  flex-flow: column nowrap;
  align-content: center;
}
.user-right-body {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-flow: column nowrap;
}
.user-info {
  width: 100%;
  height: 50%;
  display: flex;
  align-content: center;
  padding:  10px;
  box-sizing: border-box;
}
.user-tj {
  flex: 0 1 auto;
  width: 100%;
  height: 50%;
  display: flex;
  flex-flow: row nowrap;
  box-sizing: border-box;
}
.user-content {
  flex: 1 1;
  text-align: center;
  cursor: pointer;
  padding: 5px 0;
  box-sizing: border-box;
  position: relative;
}
.user-content-body {
  flex: 0 1 auto;
  text-align: left;
  align-content: center;
  font-size: 14px;
  padding: 18px 5px;
  box-sizing: border-box;
}
.custom-padding:not(:first-child)::before {
  content:'';
  position: absolute;
  background-color: #E4E7ED;
  width: 2px;
  top: 14px;
  bottom: 14px;
}
.content-span {
  font-size: 12px;
  line-height: 15px;
  background-color: #F2F6FC;
  border: 1px solid #E4E7ED;
  border-radius: 2px;
  padding: 0 3px;
  color: #67C23A;
}
</style>
